var gulp        = require('gulp');
var browserSync = require('browser-sync').create();


/*监控实时刷新页面*/
gulp.task('serve', function() {
    browserSync.init({
        server:{
               baseDir:"demo"
               }
    });
    gulp.watch("demo/js/*.js").on('change',browserSync.reload);
    gulp.watch("demo/images/*.{png,jpg,gif,ico}").on('change',browserSync.reload);
    gulp.watch("demo/styles/*.css").on('change',browserSync.reload);
    gulp.watch("demo/html/*.html").on('change',browserSync.reload);
});


gulp.task('default',function(){
     gulp.start('serve');
     });
